// 2025/10/13
// 在字符串中找出最长数字串

#include <iostream>
using namespace std;

int main() {
    string str; cin >> str;
    int l = 0, r = 0, n = str.size();
    int cl = 0, cr = 0;
    while(cr < n)
    {
        if('0' <= str[cr] && str[cr] <= '9')
        {
            cl = cr;
            while(cr < n && '0' <= str[cr] && str[cr] <= '9')
                cr++;
            if(cr - cl > r - l)
            {
                r = cr;
                l = cl;
            }
        }
        cr++;
    }
    string ans = str.substr(l, r - l);
    cout << ans << endl;
}
// 64 位输出请用 printf("%lld")